<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>请选择数据产生时间</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body onload="proLoad();" bgcolor="#f4f4f4">
  <center>
  	<table height="100%">
		<tr><td colspan="4" align="center"><b>选择数据产生时间</b></td></tr>
		<tr><td colspan="4" align="center"></td></tr>
		<tr><td align="center"><select name="yearSel" id="yearSel"></select>年<select name="monthSel" id="monthSel"></select>月</td></tr>
		<tr><td align="center"><input type='button' onclick="returnTime()" value="确定" >&nbsp;<input type='button' onclick="clearTime()" value="取消" ></td></tr>
	</table>    
  </center>
	
  </body>
</html>
<script type="text/javascript">
<!--
function proLoad(){
		//var url= dialogArguments.url;
		var inputObj=dialogArguments.input;
		var val=inputObj.value;
		var year;
		var month;
		if(val){
			year=val.substring(0,4);
			month=val.substring(5,7);
		}
		//alert('year='+year);
		//alert('month='+month);
		var nowIndex    = yearSel.options.length;                  //右边的下一个索引
    	//var selectIndex = year.options.selectedIndex;         //左边被选种项索引
		
        
		
		for(var y=2000;y<2100;y++){
			var newoption   =null;
			if(y==year){
				newoption   = new Option(y,y,true,true);			
			}else{
				newoption   = new Option(y,y,false,false);
			}
			yearSel.options[nowIndex] = newoption;
			nowIndex++;
		}
		
		nowIndex=monthSel.options.length; 
		for(var m=1;m<13;m++){
			var newoption   =null;
			if(m==month){
				newoption   = new Option(m,m,true,true);			
			}else{
				newoption   = new Option(m,m,false,false);
			}
			monthSel.options[nowIndex] = newoption;
			nowIndex++;
		}
		
	}
	
function returnTime(){
	var rtnObj = new Object();
			var yearIndex = yearSel.options.selectedIndex; 
			var year= yearSel.options[yearIndex].value;
			var monthIndex = monthSel.options.selectedIndex; 
			var month= monthSel.options[monthIndex].value;
			if(month.length==1)
				month='0'+month;
				
			rtnObj.result = year+'-'+month+'-15';

			returnValue = rtnObj;
			window.close();
}
function clearTime(){
		//var rtnObj = new Object();
		//rtnObj.result = '';
		//returnValue = rtnObj;
		window.close();
}

//-->
</script>
